// Rotation functions on 32 bit values
#define ROL32( A, n ) \
    ( ((A) << (n)) | ( ((A)>>(32-(n)))  & ( (1UL << (n)) - 1 ) ) )

#define ROR32( A, n )   ROL32( (A), 32-(n) )


typedef struct tkip
{
    ULONG	K0, K1;		// Key
	union
	{
		struct // Current state
		{
			ULONG	L;
			ULONG	R;
		};
		UCHAR	LR[8];
	};
	union
	{
		ULONG	M;		// Message accumulator (single word)
		UCHAR	Mb[4];
	};
	INT		bytes_in_M;	// # bytes in M
} tkip_t;

//VOID _append_data( PUCHAR pData, USHORT size, tkip_t *p );
VOID Mds_MicGet( IN PVOID Adapter, IN PVOID pRxLayer1, IN PUCHAR pKey, OUT PUCHAR pMic );
VOID Mds_MicFill( IN PVOID Adapter, IN PVOID pDes, IN PUCHAR XmitBufAddress );



